#import "HelloWorldListener.h"

HelloWorldListener::HelloWorldListener(NSTextField* txt)
{
	texto = txt;
}

bool HelloWorldListener::check_event(Event* ev)
{
	if (ev->get_type() == PAIR_EVENT_TYPE)
		return true;
	
	else return false;
}

void HelloWorldListener::action(void* receiver, Event* data)
{
	PairEvent* ev = (PairEvent*)data;
	
	NSString* aux = [NSString stringWithFormat: @"(%d, %d)",(int)ev->get_x(),(int)ev->get_y()];
	[texto setStringValue: aux];
}

const char* HelloWorldListener::name()
{
	return "HelloWorldListener";
}
